<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="/style/basic_layout.css" rel="stylesheet" type="text/css">
    <link href="/style/common_style.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/js/jquery/jquery.js"></script>
    <script type="text/javascript" src="/artDialog/jquery.artDialog.js?skin=blue"></script>
    <script type="text/javascript" src="/js/commonAll.js"></script>
    <title>叩丁狼教育PSS（演示版）-部门管理</title>
    <style>
        .alt td{ background:black !important;}
    </style>
</head>
<body>
<form id="searchForm" action="/permission/list" method="post">
    <div id="container">
        <div class="ui_content">
            <div class="ui_text_indent">
                <div id="box_border">
                    <div id="box_bottom">
                        <input type="button" value="加载权限" data-url="/permission/load" class="ui_input_btn01 btn_load"/>
                        <script type="text/javascript">
                        	$(".btn_load").click(function(){
                        		var url = $(this).data('url');
                        		$.dialog({
                        			title:'温馨提示',
                        			content:'亲,加载权限耗时较长,您确定加载吗?',
                        			lock:true,
                        			icon:'warning',
                                	//确认执行函数
                        			ok:function(){
                        				$.get(url,function(data){
                                      		if(data.flag){
                                      			myconfirm('加载成功','succeed',function(){
                                      				window.location.reload();
                                      			},true)
                                      		}else{
                                      			myconfirm(data.errorMsg,'error',true,true)
                                      		}
                        				})
                        			},
                                	//否不做任何操作
                        			cancel:true
                        		});
                        	});
                        </script>
                    </div>
                </div>
            </div>
        </div>
        <div class="ui_content">
            <div class="ui_tb">
                <table class="table" cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
                    <tr>
                        <th width="30"><input type="checkbox" id="all" /></th>
                        <th>编号</th>
                        <th>名称</th>
                        <th>权限表达式</th>
                        <th></th>
                    </tr>
                    <tbody>
					<c:forEach items="${result.listData}" var="ex">
                    <tr>
                        <td><input type="checkbox" name="IDCheck" class="acb" /></td>
                        <td>${ex.id}</td>
                        <td>${ex.name}</td>
                        <td>${ex.expression}</td>
                        <td>
                            <a href="javascript:;" class="btn_delete" data-deleteid="/permission/delete?id=${ex.id}">删除</a>
                        </td>
                    </tr>
					</c:forEach>
                    </tbody>
                </table>
            </div>
            <div class="ui_tb_h30">
                <div class="ui_flt" style="height: 30px; line-height: 30px;">
                    共有
                    <span class="ui_txt_bold04">${result.totalCount}</span>
                    条记录，当前第
                    <span class="ui_txt_bold04">${result.currentPage}/${result.totalPage}</span>
                    页
                </div>
                <div class="ui_frt">
                    <input type="button" value="首页" class="ui_input_btn01 btn_page" data-page="1"/>
                    <input type="button" value="上一页" class="ui_input_btn01 btn_page" data-page="${result.prevPage}"/>
                    <input type="button" value="下一页" class="ui_input_btn01 btn_page" data-page="${result.nextPage}"/>
                    <input type="button" value="尾页" class="ui_input_btn01 btn_page" data-page="${result.totalPage}"/>

                    <select name="pageSize" class="ui_select02 change_event">
                        <option>3</option>
                        <option>6</option>
                        <option>9</option>
                    </select>
                    <script type="text/javascript">
	                    	$("[name=pageSize] option").each(function(index,option){
	                			if(option.value=='${result.pageSize}'){
	                				option.selected=true;
	                			}
	                		});
	                
                    </script>
                    转到第<input type="text" name="currentPage" value="${result.currentPage}" class="ui_input_txt01" />页
                    <input type="submit" class="ui_input_btn01" value="跳转"/>
                </div>
            </div>
        </div>
    </div>
</form>
</body>
</html>
